<%var jstpl = {%>
<script>
	var app = new Vue({
		el: "#gexin_body",
		data: {
			msg: "Test"
		},
		methods: {

		}
	})
	var form = layui.form;
	form.verify({
		repass: function(value, item) {
			if($("#password").val() != value) {
				return "两次密码不一致";
			}
		}
	})

	//监听提交
	form.on('submit(upUserInfo)', function(data) {
		layer.msg(JSON.stringify(data.field));
		Ajax('/system/role/user/set_save', data.field, function(d) {
			if(d.state) {
				gx.alert("数据更新成功！");
			} else {
				alert(d.msg);
			}
		})
	});
</script>
<%};%>
<%var csstpl = {%>

<%};%>
<%layout("../layout/_layout_layui.html",{title:'密码修改',jstpl:jstpl,csstpl:csstpl}){ %>
<form id="setUserInfor" method="post">
	<input type="hidden" value="${user.id!}" name="user.id">
	<div class="layui-form" lay-filter="">
		<div class="layui-form-item">
			<label class="layui-form-label">我的角色</label>
			<div class="layui-form-mid layui-word-aux">当前角色不可更改为其它角色</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">用户名</label>
			<div class="layui-input-inline">
				<input type="text" name="username" disabled="disabled" value="${user.username!}" readonly class="layui-input">
			</div>
			<div class="layui-form-mid layui-word-aux">不可修改。一般用于后台登入名</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">姓名</label>
			<div class="layui-input-inline">
				<input type="text" name="user.name" value="${user.name!}" lay-verType="tips" lay-verify="required" autocomplete="off" placeholder="请输入昵称" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">手机</label>
			<div class="layui-input-inline">
				<input type="text" name="user.tel" value="${user.tel!}" lay-verType="tips" lay-verify="required|phone" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">邮箱</label>
			<div class="layui-input-inline">
				<input type="text" name="user.email" value="${user.email!}" lay-verType="tips" lay-verify="required|email" autocomplete="off" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-input-block">
				<button type="button" class="layui-btn" lay-submit lay-filter="upUserInfo">确认修改</button>
				<button type="reset" class="layui-btn layui-btn-primary">重新填写</button>
			</div>
		</div>
	</div>
</form>

<%}%>